#include "pocketcontrol.h"

using namespace PBVP;

PocketControl::PocketControl(QWidget *parent)
	: QDialog(parent)
{
	ui.setupUi(this);
	m_MarchDist = 40;
	m_IsoVal = 1.5f;
	m_FilterTimes = 0;

	ui.marchDistance->setText(QString().setNum(m_MarchDist));
	ui.isoValue->setText(QString().setNum(m_IsoVal));
	ui.filteringNumber->setText(QString().setNum(m_FilterTimes));

	connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(updateParameters()));
}

PocketControl::~PocketControl()
{

}

//////////////////////////////////////////////////////////////////////////
/// Slots
//////////////////////////////////////////////////////////////////////////
void PocketControl::updateParameters()
{
	m_MarchDist = ui.marchDistance->text().toFloat();
	m_IsoVal = ui.isoValue->text().toFloat();
	// m_FilterTimes = ui.filteringNumber->text().toInt();
	if (ui.filteringCheckBox->isChecked())
	{
		m_FilterTimes = 1;
	} else {
		m_FilterTimes = 0;
	}
}